package o;

import android.annotation.TargetApi;
import android.app.Activity;
import com.huawei.appmarket.service.settings.card.SettingAppSyncCard;
import o.ewm.n;

public class ehc extends NetWorkUtls {
    private BaseAlertDialog ˏ;

    @TargetApi(24)
    static class a implements cks {
        private BaseAlertDialog ˋ;
        private int ˎ;
        private boolean ˏ;
        private Activity ॱ;

        public a(BaseAlertDialog o_ckr, Activity activity, int i, boolean z) {
            this.ॱ = activity;
            this.ˎ = i;
            this.ˏ = z;
            this.ˋ = o_ckr;
        }

        public void enableNetworking() {
            if (this.ˏ) {
                this.ॱ.requestPermissions(PermissionChecker.getPermissionString(this.ˎ), this.ˎ);
            } else {
                try {
                    NetWorkUtil.setWIfi(this.ॱ.getApplicationContext(), ContentManager.getInstant().getContext().getPackageName());
                    if (this.ॱ.getIntent() != null) {
                        this.ॱ.getIntent().putExtra(SettingAppSyncCard.ˎ, 2);
                    }
                } catch (Exception e) {
                    Logger.ˎ("mainactivity", "startActivity MANAGE_APP_PERMISSIONS failed! e = " + e.getMessage());
                }
            }
            this.ˋ.ˏ();
        }

        public void upgrade() {
            this.ˋ.ˏ();
            if (this.ॱ.getIntent() != null) {
                this.ॱ.getIntent().putExtra(SettingAppSyncCard.ˎ, 0);
            }
        }

        public void ˋ() {
        }
    }

    public void showDial(Activity activity, boolean z, int i, int i2) {
        this.ˏ = BaseAlertDialog.ˋ(activity, activity.getString(n.ʼʽ), activity.getString(i));
        this.ˏ.ॱ();
        this.ˏ.ˎ(false);
        this.ˏ.ॱ(o.ckr.a.ˋ, n.ʼˌ);
        this.ˏ.ॱ(o.ckr.a.ˎ, n.ʼˑ);
        this.ˏ.ˎ(new a(this.ˏ, activity, i2, z));
    }

    public void dismiss() {
        if (this.ˏ != null) {
            this.ˏ.ˏ();
        }
    }

    public boolean isShowing() {
        if (this.ˏ != null) {
            return this.ˏ.ˎ();
        }
        return false;
    }
}
